
#ifndef UPDATE_IMAGE_PROVIDER_H
#define UPDATE_IMAGE_PROVIDER_H

#include <QQmlImageProviderBase>
#include <QQuickAsyncImageProvider>
#include <QQuickImageProvider>

class QNetworkAccessManager;

// 图片加载 同步

class ImageProvider : public QQuickImageProvider
{
public:
    explicit ImageProvider(ImageType type, Flags flags = 0);

    ~ImageProvider() override;

    QImage requestImage(const QString &id, QSize *size, const QSize &requestedSize) override;

protected:
    QNetworkAccessManager *manager_{nullptr};
};


#endif //UPDATE_IMAGE_PROVIDER_H
